package cn.tedu.charging.device.service;

import cn.tedu.charging.device.dao.repository.GunRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GunService {
    @Autowired
    private GunRepository gunRepository;
    public Boolean checkGun(Integer gunId) {
        //查询一下 是否存在 枪 枪是否空闲 select count(1) from charging_gun_info where id=#{gunId}
        //and status=1
        Integer result=gunRepository.countByIdAndStatus(gunId,1);
        return result>0;
    }
}
